/*
 * Copyright (c) 2008 Benoit Bouchez, Nicolas Giard
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package com.noocodecommit.wicket.stuff.jquery.plugin.effects.scale;

/**
 * JQuery Effects Scale Animation options set
 * 
 * @author Benoit Bouchez
 * 
 */
public class JQScaleOptions extends JQSizeOptions
{
	/** Both direction value */
	public static String DIRECTION_BOTH = "both";
	/** Horizontal direction value */
	public static String DIRECTION_HORIZONTAL = "horizontal";
	/** Vertical direction value */
	public static String DIRECTION_VERTICAL = "vertical";
	/** Top origin value */
	public static String ORIGIN_TOP = "top";
	/** Bottom origin value */
	public static String ORIGIN_BOTTOM = "bottom";
	/** Left origin value */
	public static String ORIGIN_LEFT = "left";
	/** Right origin value */
	public static String ORIGIN_RIGHT = "right";
	/** Center origin value */
	public static String ORIGIN_CENTER = "center";
	/** Middle origin value */
	public static String ORIGIN_MIDDLE = "top";
	
	/** Percent */
	private int percent;
	/** Direction */
	private String direction;
	/** Origin */
	private String[] origin = new String[2];

	/**
	 * Constructor
	 */
	public JQScaleOptions()
	{
		super();
	}

	/**
	 * Gets the percent value
	 * 
	 * @return the percent value
	 */
	public int getPercent()
	{
		return percent;
	}

	/**
	 * Sets the percent option value
	 * 
	 * @param percent
	 *            scale percent
	 */
	public void setPercent(int percent)
	{
		this.percent = percent;
		this.options.put("percent", "percent:" + percent);
	}

	/**
	 * Gets the direction value
	 * 
	 * @return the direction value
	 */
	public String getDirection()
	{
		return direction;
	}

	/**
	 * Sets the direction option value
	 * 
	 * @param direction
	 *            scale direction
	 */
	public void setDirection(String direction)
	{
		this.direction = direction;
		this.options.put("direction", "direction:'" + direction + "'");
	}

	/**
	 * Gets the origin value
	 * 
	 * @return the origin value
	 */
	public String[] getOrigin()
	{
		return origin;
	}

	/**
	 * Sets the origin option value
	 * 
	 * @param origin
	 *            scale origin
	 */
	public void setOrigin(String[] origin)
	{
		this.origin = origin;
		this.options.put("from", "origin:['" + origin[0] + "','" + origin[1] + "']");
	}

	/**
	 * Sets the origin option value
	 * 
	 * @param origin
	 *            scale origin
	 */
	public void setOrigin(int[] origin)
	{

		this.origin = new String[] { "" + origin[0], "" + origin[1] };
		this.options.put("from", "origin:[" + origin[0] + "," + origin[1] + "]");
	}
}
